package com.fqgj.sentry.policy.dao;
import com.fqgj.common.base.BaseMapper;
import com.fqgj.sentry.policy.entity.PcExecutorEntity;

import java.util.List;

/**
* User: yujianfu
* Date: 2017-07-12
* Time: 09:37:58.114
*/

public interface PcExecutorDao  extends BaseMapper<PcExecutorEntity> {

    PcExecutorEntity insertExecutor(PcExecutorEntity pcExecutorEntity);

    /**
     * 查询策略集下的所有线上执行者
     * @param policySetsId
     * @return
     */
    List<PcExecutorEntity> selectListByPolicySetId(Long policySetsId);
    /**
     * 查看当前策略集下面在某个执行者的线上版本
     * @return
     */
    PcExecutorEntity selectPcExecutorCurrent(Long policySetsId, Integer executorType,Integer active);

    /**
     * 策略集下面的 某类执行者的历史版本
     * @param policySetsId
     * @param type
     * @return
     */
    List<PcExecutorEntity> selectPcExecutorHistoryList(Long policySetsId, Integer type);

    /**
     * 策略集下某类执行者的待发布版本
     * @param policySetsId
     * @param type
     * @return
     */
    PcExecutorEntity   selectPcExecutorPending(Long policySetsId, Integer type);

    /**
     * 设置更新线上版本至历史
     * @return
     */
    Integer updateExecutorToHistory(Long policySetsId,Integer type);

    /**
     *
     * @param policySetId
     */
    void deleteByPoliceSetId(Long policySetId);

}